using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for AdmAccDao
/// </summary>
public class AdmAccDao
{
    public AdmAccDao() { }

    public bool IsValidLogin(AdmAcc acc)
    {
        SqlCommand cmd = DbProvider.CreateCommand("sp_AdmLogin");
        
        cmd.Parameters.Add("@AdmID", SqlDbType.VarChar);
        cmd.Parameters.Add("@PWD", SqlDbType.VarChar);
        cmd.Parameters.Add("@rs", SqlDbType.Bit).Direction = ParameterDirection.Output;

        cmd.Parameters["@AdmID"].Value = acc.AdmID;
        cmd.Parameters["@PWD"].Value = acc.PWD;

        DbProvider.ExecCmd(cmd);
        return (bool)cmd.Parameters["@rs"].Value;
    }
}
